Lexicographical Generation of a Generalized Dyck Language

نویسنده

  • Jens Liebehenschel
چکیده

Given two disjoint alphabets T and T ] and a relation R T T ] , the generalized Dyck language D R over T T ] consists of all words w 2 (T T ]) ? which are equivalent to the empty word " under the congruence deened by x y " mod for all (x; y) 2 R. In this paper we present an algorithm that generates all words of length 2n of the generalized Dyck language lexicograph-ically. Thereby, each Dyck word is computed from its predecessor according to the lexicographical order without any knowledge about the Dyck words generated before. Additionally, we introduce a condition on the relation R for the language to be simply generated, which means that an algorithm needs to read only the suux to be changed in order to compute the successor of a word according to the lexicographical order. Furthermore, we analyze the algorithm that generates the Dyck words. For arbitrary R, we compute the s-th moments of the random variable describing the length of the suux to be changed in the computation of the successor of a Dyck word according to the lexicographical order. 1 Overview and Deenitions In this section we introduce the generalization of the Dyck language, the lexico-graphical order needed for the lexicographical generation and present all deenitions { illustrated by several examples { for the whole paper. Further, we point out the contents of the following sections. In this paper we present an algorithm that generates all words of length 2n of the generalized Dyck language given in Deenition 1 lexicographically. The algorithm reads a word from right to left and changes a suux of that word in order to generate the next word according to the lexicographical order given in Deenition 2. be the set of opening (resp. closing) brackets. Let jSj be the cardinality of the set S, so T = t 1 and T ] = t 2. With T := T. T ] , where. denotes the disjoint union of sets, and a relation R T T ] we obtain the generalized Dyck language associated with R by D R := fw 2 T ? j w " mod g , where " denotes the empty word and is the congruence over T which is deened by (8((a ; ] b) 2 R)((a ] b " mod). Let length(w) be the number of symbols …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Ranking and Unranking of a Generalized Dyck Language

Given two disjoint alphabets T and T ] and a relation R T T ] , the generalized Dyck language D R over T T ] consists of all words w 2 (T T ]) ? which are equivalent to the empty word " under the congruence deened by x y " mod for all (x; y) 2 R. If the Dyck words are arranged according to the lexicographical order, then ranking means to determine the rank, i. e. the position, of a Dyck word. U...

متن کامل

Ranking and Unranking of Lexicographically Ordered Words: An Average-Case Analysis

We consider all words of length n of a formal language. If these words are arranged according to the lexicographical order, then ranking means to determine the position of a word of the language. Unranking is the inverse operation of ranking. For a given formal language we compute the average length of the minimal preex of a word to be read to determine its position, if the word is read from le...

متن کامل

An exhaustive generation algorithm for Catalan objects and others

The paper presents a CAT generation algorithm for Dyck paths with fixed length n. It is the formalization of a method for the exhaustive generation of these paths which can be described by two equivalent strategies. The former uses a rooted tree, the latter lists the paths and provides a visit of the nodes of the tree, basing on three simple operations. These constructions are strictly connecte...

متن کامل

Cool-lex order and k-ary Catalan structures

For any given k, the sequence of k-ary Catalan numbers, Ct,k = 1 kt+1 ( kt t ) , enumerates a number of combinatorial objects, including k-ary Dyck words of length n = kt and k-ary trees with t internal nodes. We show that these objects can be efficiently ordered using the same variation of lexicographic order known as cool-lex order. In particular, we provide loopless algorithms that generate ...

متن کامل

Counting Generalized Dyck Paths

The Catalan number has a lot of interpretations and one of them is the number of Dyck paths. A Dyck path is a lattice path from (0, 0) to (n, n) which is below the diagonal line y = x. One way to generalize the definition of Dyck path is to change the end point of Dyck path, i.e. we define (generalized) Dyck path to be a lattice path from (0, 0) to (m, n) ∈ N2 which is below the diagonal line y...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • SIAM J. Comput.

دوره 32  شماره 

صفحات  -

تاریخ انتشار 2003